<template>
    <div>
        <p>{{msg}}</p>
        <button @click="getMsg">axios获取远程服务数据</button>
        <ul>
            <li v-for="(item,key) in list" :key="key">            
                {{key}}{{item.title}}
            </li>
        </ul>
    </div>
</template>

<script>
import Axios from 'axios';
export default {
    data () {
        return {
            msg: '数据axios请求组件',
            list: []
        }
    },
    methods: {
        getMsg() {
            let url = 'http://www.phonegap100.com/appapi.php?a=getPortalList&catid=20&page=1'
            Axios.get(url).then((response)=> {
                console.log(response);
                this.list = response.data.result;
            },).catch((err)=> {
                console.log(err);
            })
           
        }
    }
}
</script>

<style>

</style>
